<template>
    <div>
      <titleTop :titleTxet="titleTxet"></titleTop>
      <ul class="ultwo">
        <li @click="actdet(item)" v-for="(item,index) in dataty" :key="index">
          <div class="li-top">
            <img :src="item.main_pic" alt="">
            <span>{{item.apply}}</span>
            <span v-if="item.is_rec==0?false:true">推荐</span>
          </div>
          <p>{{item.title}}</p>
        </li>
      </ul>
    </div>
</template>

<script>
  import titleTop from "../../com/title";
  import * as search from "../../../api/search.js"
    export default {
      name: "GengduoHuo",
      components: { titleTop },
      data(){
        return {
          titleTxet: {
            titleName: "已参与的活动",
            IsBool: true,
            IsShare: false
          },
          dataty:[]
        }
      },
      mounted(){
        let parms = {user_id:this.$store.state.user_id}
        search.myActive(parms).then(res=>{
          console.log('全部参与的活动',res)
          this.dataty = res.data;
        })
      },
      methods:{
        actdet(item){
          this.$router.push({path:'/active2/0/'+item.id});
        },
      }
    }
</script>

<style scoped>
  .ultwo{
    padding: 20px 40px;
  }
  .ultwo li{
    position: relative;
    border-radius: 20px;
    background: #e7c7fd;
    overflow: hidden;
  }
  .ultwo li .li-top{
    position: relative;
    height: 400px;
    overflow: hidden;
  }
  .ultwo li .li-top img{
    width: 100%;
    height: 100%;
  }
  .ultwo li .li-top span{
    position: absolute;
    left: 20px;
    top: 20px;
    display: inline-block;
    cursor: pointer;
  }
  .ultwo li .li-top span:nth-child(2){
    position: absolute;
    right: 20px;
    top: 20px;
    width: 90px;
    height: 40px;
    border-radius: 20px;
    text-align: center;
    line-height: 40px;
    background: #ff6174;
    color: #fff;
  }
  .ultwo li .li-top span:nth-child(3){
    width: 52px;
    height: 63px;
    background: url("/static/lyl/recom.png") no-repeat center/cover;
    font-size: 24px;
    color: #fff;
    float: right;
    text-align: center;
  }
  .ultwo li p{
    position: absolute;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    font-size: 24px;
    color: #fff;
    padding: 13px 0 10px 20px;
    background: rgba(0,0,0,0.7);
  }
</style>
